﻿<template>
    <div class="row">
        <div class="card" v-for="user in users" :key="user.id">
            <a :href="user.html_url" target="_blank">
                <img :src="user.avatar_url">
            </a>
            <p>{{user.login}}</p>
        </div>
    </div>
</template>

<script>
export default {
    name: 'List',
    components:{},
    data(){
        return{
            users:[]
        }
    },
    beforeCreate(){
        this.$bus.$on('gotoUser',(data)=>{
            console.log('接收到参数了',data)
            this.users = data
        })
    },
    beforeDestroy(){
        this.$bus.$off('gotoUser')
    },
    setup() {
        
    },
}
</script>


<style scoped>
    .card a img{
        margin: 10px 10px 10px 10px;
        width: 200px;
        height: 130px;
        background-size: cover;
        border-radius: 5%;
    }
</style>